package com.example.shopsystem.dao;

import com.example.shopsystem.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface UserMapper {
    Boolean insertUser(@Param("user") User user);

    int queryPhone(@Param("userId") String userId);

    User queryUser(@Param("userId") String userId);

    Boolean updateAddress(@Param("userId") String userId, @Param("address") String address);

    Boolean updateMoneyPwd(@Param("userId") String userId, @Param("moneyPwd") String moneyPwd);

    Boolean updateUser(@Param("user") User user);

    Boolean insertOutCost(@Param("user") User user, @Param("outMoney") double outMoney, @Param("type") int type, @Param("money") double money);

    List<ShopCar> viewShopCar(@Param("userId") String userId);

    List<Order> viewOrder(@Param("userId") String userId);

    Boolean updateShopCar(@Param("userId") String userId, @Param("good") Good good, @Param("goodNumber") int goodNumber, @Param("nowMoney") double nowMoney);

    Boolean insertShopCar(@Param("userId") String userId, @Param("good") Good good, @Param("goodNumber") int goodNumber, @Param("nowMoney") double nowMoney);

    Boolean insertCode(@Param("userId") String userId, @Param("text") String text);

    List<UserCost> viewUserCost(@Param("userId") String userId);
}
